#include<iostream>
#include<future>
#include<thread>
int main(int n,char **agv)
{
    using std::cout,std::endl,std::async;
    using namespace std::this_thread;
    auto printid =[]()
    {
        cout<<get_id()<<endl;
    };
    //Easy to use the async.
    //It can return the result of a function,by future class.
    //You can decide to how to launch it,by pass std::launch::deferred or  std::launch::async(default).
    //If you choose to defer it, it will start on the current thread
    auto re=async(std::launch::deferred,printid);
    printid();
    re.get();
    return 0; 
}